<template>
  <!-- 高维键 -->
  <div class='container'>
    <el-dialog title="预览文章" :visible.sync="dialogDataVisible" width="45%">
      <h2>{{this.formBase.title}}</h2>
      <div class="title">
        <span>{{this.formBase.createTime | parseTimeByString}}</span>
        <span>{{this.formBase.username}}</span>
        <span class="el-icon-view el-icon--left"></span>
        <span>{{this.formBase.visits}}</span>
      </div>
      <div class="content">
        <!-- {{this.formBase.articleBody}} -->
        <span v-html="this.formBase.articleBody"></span>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'ArticlesPreview',
  props: {
    formBase: {
      type: Object,
      required: true
    }
  },
  data () {
    return {
      dialogDataVisible: false
    }
  },
  methods: {
    // 弹层显示
    dialogFormV () {
      this.dialogDataVisible = true
    }
  }
}
</script>

<style scoped lang='less'>
.title {
  padding-bottom: 10px;
}
span {
  margin-left: 10px;
  margin-top: 10px;
}
.content {
  border-top: dashed 1px;
  background-color: #ccc;
  padding: 10px;
  span {
    margin-left: 0;
  }
}
h2 {
  margin: 0;
}
</style>
